import {defineStore} from 'pinia' ;
import {invoke} from "@tauri-apps/api";
import {reactive, ref} from "vue";

export const useCategoryStore = defineStore("categoryStore",()=>{
    let category_id = ref("1");
    const get_category_all = async ()=>{
        return await invoke("category_search")
    }
    const set_category_id = (id)=>{
        category_id.value = id;
    }
    const get_category_id = ()=>{
        return category_id.value;
    }
    return { get_category_all ,set_category_id ,get_category_id}
})